<?php

// Init owncloud

require_once(OC_App::getAppPath('company') . "/lib/helper.php");
require_once(OC_App::getAppPath('company') . "/lib/subaccounts.php");

$LoginStats = PUtil::checkUserLogin(true);
if ($LoginStats !== true) {
   echo $LoginStats;
   exit();
}

OCP\JSON::callCheck();

$uid = JRequest::getString("uid", "");

$model = new PCompanyModelSubAccounts();
$user = $model->getUser($uid);
$assignedJobs = $model->getAssignedJobs($uid);

$tmpl = new OCP\Template('company', 'part.subaccounts.edit', '');
$tmpl->assign('user', $user);
$tmpl->assign('assignedJobs', $assignedJobs);
$tmpl->printPage();